/***************************************************************
 * Name:      googlecalendarclientMain.h
 * Purpose:   Defines Application Frame
 * Author:    Daniel King (cnkknd@gmail.com)
 * Created:   2007-04-22
 * Copyright: Daniel King ()
 * License:
 **************************************************************/

#ifndef GOOGLECALENDARCLIENTMAIN_H
#define GOOGLECALENDARCLIENTMAIN_H

#include "wx_pch.h"
#include "googleCalendar.h"

class LoginForm: public wxDialog
{
	public:
		LoginForm(const wxString& title);
		~LoginForm();

		GoogleCalendar *m_pGoogleCalendar;
		bool m_bAutoLogin, m_bLoginImmediately;
	private:
		enum
		{
		    idTimer = 1000,
			idMenuQuit,
			idMenuAbout,
			idLoginButton,
			idConnectImmediately,
			idStopConnecting
		};
		wxFlexGridSizer *sizerLogin;
		wxBoxSizer* sizerLoginMain, *sizerLoginProcess, *sizerLoginOpt;
		wxTextCtrl *m_pEditLoginAccount, *m_pEditLoginPasswd;
		wxCheckBox *m_pCbLoginOptRemAccount, *m_pCbLoginOptRemPasswd, *m_pCbLoginOptAutoLogin;
		wxStaticText* m_pStaictCountdown;

        wxTimer *m_pTimer;

		bool m_bEncodedPasswd;
		wxString m_sEncodedPasswd;

		void Login();
		void OnClose(wxCloseEvent& event);
		void OnQuit(wxCommandEvent& event);
		void OnAbout(wxCommandEvent& event);
		void OnLogin(wxCommandEvent& event);
		void OnCreate(wxInitDialogEvent &event);
		void OnEditMouseEnter(wxMouseEvent &event);
		void OnTimer(wxTimerEvent &event);
		void OnConnectImmediately(wxCommandEvent &event);
		void OnStopConnecting(wxCommandEvent &event);
		DECLARE_EVENT_TABLE()
};


#endif // googlecalendarclientMAIN_H
